public class test10_16_1 {
	public int removeElement(int[] nums, int val) {
		int slowIndex = 0;
		for(int fastIndex = 0; fastIndex<nums.length; fastIndex++) {
			if(nums[fastIndex] != val) { //反之，当快指针遇到val时，慢指针停留到val处，等待下一个元素前移将它替换
				nums[slowIndex] = nums[fastIndex];
				slowIndex++;
			}
		}
		return slowIndex;
	}
}
